class Person < ActiveRecord::Base
	belongs_to :organization
	
	has_one :person_photo
	
	def fullname
		[lastname, firstname, middlename].join(' ').strip
	end
	
	def fullname=(new_fullname)
		split = new_fullname.split(' ', 3)
		self.lastname   = split[0]
		self.firstname  = split[1]
		self.middlename = split[2]
	end
end
